package com.atguigu.strategy;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description:
 * @create: 2022-04-04 10:32
 **/
public class ToyDuck extends Duck{
    @Override
    public void display() {
        System.out.println("这是玩具鸭");
    }
    //需要重写父类的所有方法

    @Override
    public void quack(){
        System.out.println("玩具鸭不能嘎嘎叫~~~");
    }

    @Override
    public void swim(){
        System.out.println("玩具鸭不会游泳~~");
    }

    @Override
    public void fly(){
        System.out.println("玩具鸭不会飞翔~~");
    }
}
